<?php

class Application_Model_CatalogCategories
{
	protected $dbTable;
	
	public function __construct()
	{
		$this->dbTable = new Application_Model_DbTable_CatalogCategories();
	}
	
	public function getTable()
	{
		return $this->dbTable;
	}
	
	public function getCategory($helper, $name)
	{
		$helper->setTable($this->dbTable);
		
		try
		{
			$category = $helper->getItem($name, 'name');
		}
		catch(Exception $e)
    	{
    		throw new Zend_Controller_Exception($e->getMessage());
		}
		
		return $category;
	}
}